//
//  ViewController.m
//  BrokenLine
//
//  Created by 彤辉 沈 on 12-2-21.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"
#import "BrokenLineView.h"

@implementation ViewController

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    BrokenLineView* view = [[BrokenLineView alloc] initWithFrame:CGRectMake(10, 10, 460, 280)];
    NSArray* date = [[NSArray alloc]initWithObjects:[NSNumber numberWithInt:2],
                                                    [NSNumber numberWithInt:3],
                                                    [NSNumber numberWithInt:4],
                                                    [NSNumber numberWithInt:5],
                                                    [NSNumber numberWithInt:7],
                                                    nil];
    //NSLog(@"date:%i",[(NSNumber*)[date objectAtIndex:3] intValue]);
    NSArray* number = [[NSArray alloc]initWithObjects:[NSNumber numberWithInt:5],
                       [NSNumber numberWithInt:6],
                       [NSNumber numberWithInt:4],
                       [NSNumber numberWithInt:1],
                       [NSNumber numberWithInt:7],
                       nil];
    view.groupData = [NSArray arrayWithObjects:date,number, nil];
    [self.view addSubview:view];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    /*if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } else {*/
        return UIInterfaceOrientationIsLandscape(interfaceOrientation);
    //}
}

- (void)dealloc {
    [super dealloc];
}
@end
